package com.cn.wanxi.service.impl;

import com.cn.wanxi.dao.NewsDao;
import com.cn.wanxi.dao.impl.NewsImpl;
import com.cn.wanxi.model.NewsModel;
import com.cn.wanxi.model.ResultModel;
import com.cn.wanxi.service.NewsService;

public class NewsServiceImpl implements NewsService {
    private NewsDao newsDao=new NewsImpl();
    @Override
    public ResultModel add(NewsModel newsModel) {
        return ResultModel.getResultModel(newsDao.add(newsModel));
    }

    @Override
    public ResultModel update(NewsModel newsModel) {
        return ResultModel.getResultModel(newsDao.update(newsModel));
    }

    @Override
    public ResultModel delete(NewsModel newsModel) {
        return ResultModel.getResultModel(newsDao.delete(newsModel));
    }

    @Override
    public ResultModel findById(NewsModel newsModel) {
        return ResultModel.getResultModel(newsDao.findById(newsModel));
    }

    @Override
    public ResultModel findAll(NewsModel newsModel) {
        return ResultModel.getResultModel(newsDao.findAll(newsModel));
    }

    @Override
    public ResultModel getCount(NewsModel newsModel) {
        return ResultModel.getResultModel(newsDao.getCount(newsModel));
    }
}
